-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add module builder #48
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I would love for people to test this, maybe I missed some corner cases.
In my tests, I tried building with packages, folders, and individual files. I haven't tried disabling services, removing packages or anything else.
''; | ||
}; | ||
|
||
subtarget = lib.mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I called it subtarget
instead of variant
, because it seems like OpenWRT uses this name.
# TODO: move arch to profiles | ||
detectedArch = hashedTarget.packagesArch; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arch
is already a property in profiles.json
. I feel like it's more fitting to get this info from there, than from the feeds, since it's a property of a specific board/target
I'd like to review but I haven't been using the imagebuilder (or openwrt). |
I like this. Please feel encouraged to follow through. |
7955ae5
to
177716b
Compare
Thanks for your encouragement, @astro ! I've updated the docs module, exposing both markdown and json. At a certain iteration, I realized it looked almost like https://github.com/astro/microvm.nix/blob/2ae08de8e8068b00193b9cfbc0acc9dfdda03181/pkgs/doc.nix, so I just copied most of the stuff from there 😅 I also added support for "separate Kmods" and tested the build with both "old" (23.05.5) and "new" (24.10.0-rc4) versions. Builds fine. |
Happy New Year everybody! I've added a new package to generate/update module docs and a GitHub flow to do it from GHA. I think this PR is ready for a proper review now. |
Co-authored-by: Sandro <[email protected]>
This PR adds a module interface to the builder derivation. This brings benefits such as strict options definition, better type-checks, and flexibility for future improvements or modifications.
I left the old builder in place for backward compatibility. In the future, it could be removed, and an "adapter" could be installed to convert old inputs into the new module system and maintain backward compatibility.
The module is inspired by @tomeon's nix-openwrt-imagebuilder-module project, but it's structured differently and the module itself is simpler. Please let me know if you feel it isn't fair to your work.
Opening this as a draft to gather opinions.
If everything is fine I will add module documentation and update README to tell users to use
build-module
in a follow-up PR to not pollute this one.I also moved examples into a dedicated folder, since we have 4 of them now.
Closes #22